Register Facebook Bot In DecAds System

1.Running “project” and login to DecAds Dashboard.

2.Get your account from DecAds Member and log in then start preparing create your bot in DecAds System.

Picture1
Then click bot service
Picture2
There are three steps that you need to do:

a) Create “Logic”

Picture3
Click the blue button
Picture4
Insert name and description for your logic. Then you will be able to redirect to this page.
Picture5
-Create first entity.
Picture6
Then click save.
Always have phase 0, so you need to create phase 0 first.
-Create second entity.
Picture7
And add response
Picture8
Then click save.
Picture9
Finish create Logic.
*Remember your logic name.

b) Create “Profile”

The next step you will need a profile for your Bot service.
Picture10
Click the blue button to create a new profile.
Picture11
Insert name and another information.
Picture12
Finish create profile.
*Remember your profile name.

c) Create “Bot”

Picture13
Click the blue button to start create Bot Service.
Picture14
About Profile ID - You need to choose the Profile name that you create before.
About Logic ID - You need to choose the Logic name that you create before.
Then click save.
Finish create a profile.
*Remember your Bot service name.

3. Create Your Facebook Channel info.

-Start gathering all information.

a) Core bot ID(Core bot name): Facebook Bot Service.

b) Facebook App Serect & Facebook Page token:

To get App Serect in facebook you need to create an application on facebook developer.
Go to : https://developers.facebook.com/?locale=en_US
Picture15
Add new application
Picture16
Then click “Create App ID”.
Picture17
Submit the captcha
Picture18
You will be able to redirect to this page.
Then click “Set Up” Button.
Picture19
Scroll your mouse until you see two red squares.
Before you do next step make sure that you have App ID.
-For Facebook App Serect Click Dashboard on left panel menu
Picture20
There are two things need to write down.
-App ID And Facebook App Serect
Picture21
About Facebook App Serect.
Click button “Show”
Picture22
Enter your Facebook password to get the App Serect.
After that you will see the App Serect which mean you just get the Facebook App Serect
Picture23

b.1) Token Generation (Facebook Page token).

Picture24
Choose your page that you create before(you will create this in document “1.RegisterBotchatOnFacebook”).
Picture25
Click the blue button to continue.
After that you will see the page access token.
Picture26
Now you have Facebook Page token.

b.2) Webhooks.

Picture27
Click Setup Webhooks
Picture28
The syntax of CallBack URL: https://facebook-api-demo.azurewebsites.net/api/FacebookMessage/219782061892618
Which “219782061892618” is an App ID You get before.
Stick “messages” and “messaging_postbacks”.
Remember the Verify Token.
Then click Verify and Save.
Picture29
Choose page you have created before to subscribe webhook.
Picture30
Now you completely finish create bot in facebook developer website.
Now you have these information
+Facebook App ID.
+Facebook Bot Name.
+Core bot ID(Core bot name).
+Facebook App Serect.
+Facebook Page Token.
+Facebook Verify Token.
Make sure that you have all of these information then you start Create Facebook Channel.
-Start Create facebook channel.
Picture31
Click the blue button to start create Facebook channel info.
Picture32
Insert all six information that you have create before then click the button “save” at the bottom. After you save it ,you will be back to main page (facebook channel info).
Picture33
Finish Create facebook channel info.

4.Add user to test and Chat with the Bot.

Picture34
Click “Roles” To Add tester for your bot.
Picture35
Click “Add tester”.
Make sure that you have the id of you second facebook.
Picture36
Picture37
Enter that ID and click “Submit”
Picture38
Finish Adding tester.
Now use your second facebook to chat with the bot.
Picture39
Now use your second facebook to chat with the bot.
Picture40

Done !!!